\hypertarget{hal_8h}{\section{include/hal.h File Reference}
\label{hal_8h}\index{include/hal.\-h@{include/hal.\-h}}
}


Header file for H\-A\-L (Hardware Abstraction Layer)  


\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{hal_8h_abe5394ce1dc0a256fd5047e8397020b0}{H\-A\-L\-\_\-\-I\-O\-\_\-\-Config} (int baudrate)
\begin{DoxyCompactList}\small\item\em Configure serial device. \end{DoxyCompactList}\item 
void \hyperlink{hal_8h_a9bf20d3fd04aedb2ea857abb4c494586}{H\-A\-L\-\_\-\-I\-O\-\_\-\-I\-S\-R} ()
\begin{DoxyCompactList}\small\item\em Serial I\-O Interrupt Service Routine. \end{DoxyCompactList}\item 
\hyperlink{pintaros_8h_aaf0f0cca584c8202c7ee0f4a368bdd50}{uint8\-\_\-t} \hyperlink{hal_8h_a136930f47e2cdb4cdd6bc147b9703b0f}{H\-A\-L\-\_\-\-I\-O\-\_\-\-Rx\-Byte} ()
\begin{DoxyCompactList}\small\item\em Receive 1 byte data. \end{DoxyCompactList}\item 
int \hyperlink{hal_8h_a44bdcc0e13a30d712528ac1aa4f2dc61}{H\-A\-L\-\_\-\-I\-O\-\_\-\-Tx\-Byte} (\hyperlink{pintaros_8h_aaf0f0cca584c8202c7ee0f4a368bdd50}{uint8\-\_\-t} data)
\begin{DoxyCompactList}\small\item\em Transmit 1 byte data. \end{DoxyCompactList}\item 
\hyperlink{pintaros_8h_aaf0f0cca584c8202c7ee0f4a368bdd50}{uint8\-\_\-t} \hyperlink{hal_8h_a3d06a5fa8ad09515b216326056a64de3}{H\-A\-L\-\_\-\-Mem\-\_\-\-Read\-Byte} (int address)
\begin{DoxyCompactList}\small\item\em Read 1 byte data. \end{DoxyCompactList}\item 
int \hyperlink{hal_8h_a5faa4d3ad25af637f0606fa329493320}{H\-A\-L\-\_\-\-Mem\-\_\-\-Write\-Byte} (int address, \hyperlink{pintaros_8h_aaf0f0cca584c8202c7ee0f4a368bdd50}{uint8\-\_\-t} data)
\begin{DoxyCompactList}\small\item\em Write 1 byte data. \end{DoxyCompactList}\item 
int \hyperlink{hal_8h_aa8963fbd60ed1048b68690373edfe507}{H\-A\-L\-\_\-\-Mem\-\_\-\-Check} ()
\begin{DoxyCompactList}\small\item\em Check the integrity. \end{DoxyCompactList}\item 
int \hyperlink{hal_8h_aad8b85bbedaf1968c3eda51574aacbd4}{H\-A\-L\-\_\-\-Mem\-\_\-\-Init} ()
\begin{DoxyCompactList}\small\item\em Initialize memory. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\hypertarget{hal_8h_a42261e806293a1ae46f6e600c78b4a3f}{int $\ast$ \hyperlink{hal_8h_a42261e806293a1ae46f6e600c78b4a3f}{Rx\-\_\-callback\-\_\-ptr}}\label{hal_8h_a42261e806293a1ae46f6e600c78b4a3f}

\begin{DoxyCompactList}\small\item\em pointer of Rx transmission handler to call by the interrupt handler \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Header file for H\-A\-L (Hardware Abstraction Layer) \begin{DoxyAuthor}{Author}
Ricky Hariady (\href{mailto:ricky.hariady@enter.web.id}{\tt ricky.\-hariady@enter.\-web.\-id})
\end{DoxyAuthor}
\begin{DoxyDate}{Date}
7/10/2013 
\end{DoxyDate}


\subsection{Function Documentation}
\hypertarget{hal_8h_abe5394ce1dc0a256fd5047e8397020b0}{\index{hal.\-h@{hal.\-h}!H\-A\-L\-\_\-\-I\-O\-\_\-\-Config@{H\-A\-L\-\_\-\-I\-O\-\_\-\-Config}}
\index{H\-A\-L\-\_\-\-I\-O\-\_\-\-Config@{H\-A\-L\-\_\-\-I\-O\-\_\-\-Config}!hal.h@{hal.\-h}}
\subsubsection[{H\-A\-L\-\_\-\-I\-O\-\_\-\-Config}]{\setlength{\rightskip}{0pt plus 5cm}int H\-A\-L\-\_\-\-I\-O\-\_\-\-Config (
\begin{DoxyParamCaption}
\item[{int}]{baudrate}
\end{DoxyParamCaption}
)}}\label{hal_8h_abe5394ce1dc0a256fd5047e8397020b0}


Configure serial device. 

Set the serial device speed, etc


\begin{DoxyParams}{Parameters}
{\em baudrate} & baudrate used for transmission \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Result 
\end{DoxyReturn}
\hypertarget{hal_8h_a9bf20d3fd04aedb2ea857abb4c494586}{\index{hal.\-h@{hal.\-h}!H\-A\-L\-\_\-\-I\-O\-\_\-\-I\-S\-R@{H\-A\-L\-\_\-\-I\-O\-\_\-\-I\-S\-R}}
\index{H\-A\-L\-\_\-\-I\-O\-\_\-\-I\-S\-R@{H\-A\-L\-\_\-\-I\-O\-\_\-\-I\-S\-R}!hal.h@{hal.\-h}}
\subsubsection[{H\-A\-L\-\_\-\-I\-O\-\_\-\-I\-S\-R}]{\setlength{\rightskip}{0pt plus 5cm}void H\-A\-L\-\_\-\-I\-O\-\_\-\-I\-S\-R (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{hal_8h_a9bf20d3fd04aedb2ea857abb4c494586}


Serial I\-O Interrupt Service Routine. 

check if there a data arrive, then Call \hyperlink{transmission_8h_a1de9404b5817c6a4c51eea56c32eedf3}{trans\-Rx()} function to collect it

\begin{DoxyReturn}{Returns}
none 
\end{DoxyReturn}
\hypertarget{hal_8h_a136930f47e2cdb4cdd6bc147b9703b0f}{\index{hal.\-h@{hal.\-h}!H\-A\-L\-\_\-\-I\-O\-\_\-\-Rx\-Byte@{H\-A\-L\-\_\-\-I\-O\-\_\-\-Rx\-Byte}}
\index{H\-A\-L\-\_\-\-I\-O\-\_\-\-Rx\-Byte@{H\-A\-L\-\_\-\-I\-O\-\_\-\-Rx\-Byte}!hal.h@{hal.\-h}}
\subsubsection[{H\-A\-L\-\_\-\-I\-O\-\_\-\-Rx\-Byte}]{\setlength{\rightskip}{0pt plus 5cm}{\bf uint8\-\_\-t} H\-A\-L\-\_\-\-I\-O\-\_\-\-Rx\-Byte (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{hal_8h_a136930f47e2cdb4cdd6bc147b9703b0f}


Receive 1 byte data. 

Receive 1 byte data from from serial I\-O

\begin{DoxyReturn}{Returns}
the data byte received 
\end{DoxyReturn}
\hypertarget{hal_8h_a44bdcc0e13a30d712528ac1aa4f2dc61}{\index{hal.\-h@{hal.\-h}!H\-A\-L\-\_\-\-I\-O\-\_\-\-Tx\-Byte@{H\-A\-L\-\_\-\-I\-O\-\_\-\-Tx\-Byte}}
\index{H\-A\-L\-\_\-\-I\-O\-\_\-\-Tx\-Byte@{H\-A\-L\-\_\-\-I\-O\-\_\-\-Tx\-Byte}!hal.h@{hal.\-h}}
\subsubsection[{H\-A\-L\-\_\-\-I\-O\-\_\-\-Tx\-Byte}]{\setlength{\rightskip}{0pt plus 5cm}int H\-A\-L\-\_\-\-I\-O\-\_\-\-Tx\-Byte (
\begin{DoxyParamCaption}
\item[{{\bf uint8\-\_\-t}}]{data}
\end{DoxyParamCaption}
)}}\label{hal_8h_a44bdcc0e13a30d712528ac1aa4f2dc61}


Transmit 1 byte data. 

Transmit 1 byte data to serial I\-O


\begin{DoxyParams}{Parameters}
{\em data} & data byte to transmit v $\ast$\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Result 
\end{DoxyReturn}
\hypertarget{hal_8h_aa8963fbd60ed1048b68690373edfe507}{\index{hal.\-h@{hal.\-h}!H\-A\-L\-\_\-\-Mem\-\_\-\-Check@{H\-A\-L\-\_\-\-Mem\-\_\-\-Check}}
\index{H\-A\-L\-\_\-\-Mem\-\_\-\-Check@{H\-A\-L\-\_\-\-Mem\-\_\-\-Check}!hal.h@{hal.\-h}}
\subsubsection[{H\-A\-L\-\_\-\-Mem\-\_\-\-Check}]{\setlength{\rightskip}{0pt plus 5cm}int H\-A\-L\-\_\-\-Mem\-\_\-\-Check (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{hal_8h_aa8963fbd60ed1048b68690373edfe507}


Check the integrity. 

Check integrity of non-\/volatile memory (E\-E\-P\-R\-O\-M/flash)


\begin{DoxyParams}{Parameters}
{\em address} & virtual address of memory want to check \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Result 
\end{DoxyReturn}
\hypertarget{hal_8h_aad8b85bbedaf1968c3eda51574aacbd4}{\index{hal.\-h@{hal.\-h}!H\-A\-L\-\_\-\-Mem\-\_\-\-Init@{H\-A\-L\-\_\-\-Mem\-\_\-\-Init}}
\index{H\-A\-L\-\_\-\-Mem\-\_\-\-Init@{H\-A\-L\-\_\-\-Mem\-\_\-\-Init}!hal.h@{hal.\-h}}
\subsubsection[{H\-A\-L\-\_\-\-Mem\-\_\-\-Init}]{\setlength{\rightskip}{0pt plus 5cm}int H\-A\-L\-\_\-\-Mem\-\_\-\-Init (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{hal_8h_aad8b85bbedaf1968c3eda51574aacbd4}


Initialize memory. 

Initialize the non-\/volatile memory (E\-E\-P\-R\-O\-M/flash). Call once when O\-S Finalize.

\begin{DoxyReturn}{Returns}
virtual size of the memory available 
\end{DoxyReturn}
\hypertarget{hal_8h_a3d06a5fa8ad09515b216326056a64de3}{\index{hal.\-h@{hal.\-h}!H\-A\-L\-\_\-\-Mem\-\_\-\-Read\-Byte@{H\-A\-L\-\_\-\-Mem\-\_\-\-Read\-Byte}}
\index{H\-A\-L\-\_\-\-Mem\-\_\-\-Read\-Byte@{H\-A\-L\-\_\-\-Mem\-\_\-\-Read\-Byte}!hal.h@{hal.\-h}}
\subsubsection[{H\-A\-L\-\_\-\-Mem\-\_\-\-Read\-Byte}]{\setlength{\rightskip}{0pt plus 5cm}{\bf uint8\-\_\-t} H\-A\-L\-\_\-\-Mem\-\_\-\-Read\-Byte (
\begin{DoxyParamCaption}
\item[{int}]{address}
\end{DoxyParamCaption}
)}}\label{hal_8h_a3d06a5fa8ad09515b216326056a64de3}


Read 1 byte data. 

Read 1 byte data from non-\/volatile memory (E\-E\-P\-R\-O\-M/\-Flash)


\begin{DoxyParams}{Parameters}
{\em address} & virtual address of memory want to read \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
data readed 
\end{DoxyReturn}
\hypertarget{hal_8h_a5faa4d3ad25af637f0606fa329493320}{\index{hal.\-h@{hal.\-h}!H\-A\-L\-\_\-\-Mem\-\_\-\-Write\-Byte@{H\-A\-L\-\_\-\-Mem\-\_\-\-Write\-Byte}}
\index{H\-A\-L\-\_\-\-Mem\-\_\-\-Write\-Byte@{H\-A\-L\-\_\-\-Mem\-\_\-\-Write\-Byte}!hal.h@{hal.\-h}}
\subsubsection[{H\-A\-L\-\_\-\-Mem\-\_\-\-Write\-Byte}]{\setlength{\rightskip}{0pt plus 5cm}int H\-A\-L\-\_\-\-Mem\-\_\-\-Write\-Byte (
\begin{DoxyParamCaption}
\item[{int}]{address, }
\item[{{\bf uint8\-\_\-t}}]{data}
\end{DoxyParamCaption}
)}}\label{hal_8h_a5faa4d3ad25af637f0606fa329493320}


Write 1 byte data. 

Write 1 byte data to non-\/volatile memory (E\-E\-P\-R\-O\-M/flash)


\begin{DoxyParams}{Parameters}
{\em address} & virtual address of memory want to write \\
\hline
{\em data} & data want to write \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Result 
\end{DoxyReturn}
